WebSTAR is a great server, but that's all it can do - serve. It will serve a wide variety of files, but it doesn't do anything special with them. In order to have any kind of interaction with the user, you need to create applications that will work with WebSTAR to extend its capabilities. These applications are responsible for things like maps, online forms, document and database searching, and even pages that show the current time and weather for your city.
Chuck Shotton has built two methods into WebSTAR for communicating with external applications. The first method uses the "search" interface. The second uses CGI, the Common Gateway Interface. Both of these are common to a wide base of servers and are very nearly a standard, although the method of communicating with them varies from server to server. In WebSTAR's case, Apple events are used to communicate. Apple events are a method available in the MacOS for applications to pass information back and forth, including instructions for another application, like "please open up and print this document".
Both of these methods work in a very similar manner. First, the information that needs to be sent to the application is appended to the URL. With the "search" method, a dollar sign ($) is used to indicate the end of the file reference and the beginning of data (e.g. "http://www.uwtc.washington.edu/Computing/searchme$text_to_find"). With the CGI method, a question mark (?) is used instead. The second step is to create an Apple event message containing the URL and the data. The third step is to send this Apple event to the correct application. The URL is used to determine what the correct application is. Instead of specifying a document in the URL, you specify the application (e.g. "/Computing/WWW/TestApp.cgi"). The final step, for WebSTAR, is to wait for the application to send an Apple event back containing directions on what to do. The Apple event that is returned can either contain HTML text (which is passed right back to the user), or can contain the URL to a document to be opened (this is called "URL redirection"), or can contain one of several other codes to indicate an error of some kind.
The two methods seem very similar, but in actuality the CGI method is far superior. It can handle quite a bit of data, where the "search" method is limited to only very short strings. The CGI method can also be run asynchronously, so that the server isn't tied up handling just one request at a time. The CGI application gets much more information from WebSTAR, like a username and machine address, a password (if needed), the call pathway, and even the name of the client software being used. For these reasons, the search interface is no longer useful and may even disappear entirely. In the following pages I will focus entirely on CGI's.
If you have any problems with the lessons, read these guidelines for contacting me with questions. I will assume that you have read them and probably ignore anyone who clearly hasn't.